﻿using System;
using System.Collections.Generic;
using System.Linq;

using PortalIntranet.DatabaseComponents;
using PortalIntranet.DatabaseComponents.Seguranca;
using PortalIntranet.ObjectComponents.WebParts.Aniversariantes;
using PortalIntranet.DatabaseComponents.WebParts;
using PortalIntranet.BusinessComponents.Seguranca;

namespace PortalIntranet.BusinessComponents.WebParts.Aniversariantes
{
	public class AniversariantesBll
	{
		public static WPAniversariantes ConverterWebPart(int empresa, WebPart webpart)
		{
			List<Usuario> usuarios = UsuariosBll.ListarAniversariantes(empresa, DateTime.Now.Month);
			WPAniversariantes wpaniver = new WPAniversariantes(webpart);

			foreach (var item in usuarios)
			{
				wpaniver.Aniversariantes.Add(new AniversarianteInfo(item));
			}

			return wpaniver;
		}
	}
}
